/*
 * Copyright @ 2024 weili23
 * com.sky.controller.admin 16:28
 * All right reserved.
 */

package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @desc:
 * @author: weili23
 * @Date: 2024/10/31 16:49
 * @version: 1.0
 */
@Api(tags = "用户端登录相关接口")
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @ApiOperation("根据授权码code获取openid")
    @PostMapping("/user/login")
    public Result<UserLoginVO> byCodeGetOpenid(@RequestBody UserLoginDTO userLoginDTO){
        UserLoginVO vo = userService.byCodeGetOpenid(userLoginDTO.getCode());
        return Result.success(vo);
    }

}
